/**
 * This class is the place holder for the all the UDP server details
 * used for different entities. 
 */
package com.comp6231.common;

import java.util.Hashtable;

import com.comp6231.coordinator.Coordinator;

/**
 * @author Farzana Alam
 * 
 */
public class EntityInitiator {

	// replica list
	/*
	 * Key: Replica Name; Value: [0] => Host Name; [1] => Data UDP Port; [2] =>
	 * Control UDP Port;
	 */
	static public final Hashtable<String, String[]> replicaList = new Hashtable<String, String[]>();

	static public final Hashtable<String, String[]> frontEndList = new Hashtable<String, String[]>();

	static public Hashtable<String, Coordinator> replicaObjects = new Hashtable<String, Coordinator>();

	static public final String replica1_name = "Replica1";
	static public final String replica2_name = "Replica2";
	static public final String replica3_name = "Replica3";

	static public final int replica1_ID = 1;
	static public final int replica2_ID = 2;
	static public final int replica3_ID = 3;

	static public final String frontEnd_name = "FrontEnd";

	static public final String replica1_hostName = "localhost";
	static public final String replica2_hostName = "localhost";
	static public final String replica3_hostName = "localhost";

	static public final String frontEnd_hostName = "localhost";

	static public final String replica1_UDPPort_data = "5566";
	static public final String replica2_UDPPort_data = "6677";
	static public final String replica3_UDPPort_data = "7788";

	static public final String frontEnd_UDPPort_data = "8899";

	static public final String replica1_UDPPort_control = "5565";
	static public final String replica2_UDPPort_control = "6676";
	static public final String replica3_UDPPort_control = "7787";

	static public final String frontEnd_UDPPort_control = "8898";

	static public final String[] replica1_array = new String[] {
			replica1_hostName, replica1_UDPPort_data, replica1_UDPPort_control };
	static public final String[] replica2_array = new String[] {
			replica2_hostName, replica2_UDPPort_data, replica2_UDPPort_control };
	static public final String[] replica3_array = new String[] {
			replica3_hostName, replica3_UDPPort_data, replica3_UDPPort_control };
	static public final String[] frontEnd_array = new String[] {
			frontEnd_hostName, frontEnd_UDPPort_data, frontEnd_UDPPort_control };

	static {
		replicaList.put(replica1_name, replica1_array);
		replicaList.put(replica2_name, replica2_array);
		replicaList.put(replica3_name, replica3_array);
		frontEndList.put(frontEnd_name, frontEnd_array);
	}

}
